package com.chujian.framework.util.mybatis.wrapper;

import org.apache.commons.lang3.StringUtils;

/**
 * 字符串类构建
 */
public class FieldStringWrapperBuilder implements IFieldWrapperBuilder {

    @Override
    public boolean build(WrapperUnit unit) {
        if (String.class.isAssignableFrom(unit.field.getType())) {
            if (StringUtils.isNotEmpty(unit.value.toString())) {
                unit.wrapper.like(unit.col, unit.value);
            }
            return true;
        }
        return false;
    }
}
